package com.hb.trade.client.project;

import com.hb.core.pojo.Attachment;
import com.hb.core.pojo.project.section.dto.BidSectionTenderDTO;
import com.hb.core.pojo.project.section.entity.BidSectionTender;
import org.fzzn.core.model.msg.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 投标人操作服务
 *
 * @author zhaojk
 */
@FeignClient("hb-project")
public interface TenderSectionClient {
    /**
     * 获取指定标段和投标人ID的投标文件
     *
     * @param sectionId 标段ID
     * @param tenderId  投标人ID
     * @return
     */
    @PostMapping("/bidSectionTender/tenderDocument")
    Message<Attachment> tenderDocument(@RequestParam("sectionId") Long sectionId,
                                       @RequestParam("tenderId") Long tenderId);

    /**
     * 保存解密后的投标文件
     *
     * @param sectionTender#decTenderDocument 后端保存逻辑会将这个对象转换为JSON字符串直接保存, 无其他逻辑
     * @return
     */
    @PostMapping("/bidSectionTender/saveDecryptFile")
    Message<Boolean> saveDecryptFile(BidSectionTenderDTO sectionTender);

    /**
     * 保存投标文件信息
     * @param sectionTenderDTO
     * @return
     */
    @PostMapping("/bidSectionTender/saveTenderFileInfo")
    Message<BidSectionTender> saveTenderFileInfo(@RequestBody BidSectionTenderDTO sectionTenderDTO);
}
